<?php
declare (strict_types=1);

// +----------------------------------------------------------------------
// | SCApi
// +----------------------------------------------------------------------
// | 版权所有 2021~2022 贾二小 [ http://www.ipsoul.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://www.ipsoul.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// | 免费声明 ( http://doc.ipsoul.com/disclaimer )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/jiaerxiao/scapi
// | github 代码仓库：https://github.com/jiaerxiao/scapi
// +----------------------------------------------------------------------

namespace app\system\controller;

use app\common\controller\SystemBaseController;
use app\system\facade\FileFacade;
use hg\apidoc\annotation\Author;
use hg\apidoc\annotation\Group;
use hg\apidoc\annotation\Sort;


/**
 * 数据字典
 * @Group("System")
 * @Sort(2)
 */
class File extends SystemBaseController
{
    /**
     * 初始化
     */
    public function initialize()
    {
        $this->logName = "数据字典";
        parent::initialize();
    }

    /**
     * 上传文件
     * @Author("贾二小")
     * @since 2021/12/19
     */
    public function upload()
    {
        $file = request()->file('file');
        //上传到本地服务器
        $data = FileFacade::upload($file);
        //返回
        self::success($data);
    }
}